package com.zhuanzhuan.hero.user.enums;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName LabelEnum
 * @Description
 * @Author hanjunjun
 * @Date 2024/6/19 15:50
 */
@Getter
public enum LabelCodeEnum {

    //---------------一级-------------------
    FIRST_CHANNEL("1-19L5", "渠道&偏好"),
    FIRST_CATE("1-4849", "主营品类"),
    FIRST_SERVICE("1-49VE", "服务能力"),
    FIRST_BRAND("2-205A", "优势品牌"),
    FIRST_GOODS("2-WGFD", "优势货类"),
    //---------------一级-------------------

    /**
     * 主营品类标签  一级的
     */
    FIRST_MANAGEMENT_CATE("1-4849", "主营品类"),

    /**
     * 主营品类标签  二级的
     */
    MANAGEMENT_CATE("1-CATE", "主营品类"),

    /**
     * 服务能力标签 二级
     */
    SERVICE_ABILITY("1-A6H8", "服务能力"),

    /**
     * 优势介绍二级标签：盘古手机品牌  该code作为label_info表里的labelCode
     */
    ADVANTAGE_PANGU_MOBILE_BRAND("2-BRAND", "盘古手机品牌"),

    /**
     * 内容分类标签：卖货   该该code作为label_info表里的labelCode
     */
    CONTENT_SELLING("6-SELLING", "卖货"),
    CONTENT_EXPERIENCE("6-EXPERIENCE", "经验"),
    CONTENT_DAILY("6-DAILY", "日常"),
    CONTENT_COOPERATE("6-COOPERATE", "共创侠客汇"),

    /**
     * 品类、品牌、机型 的子标签比较特殊，不走本地，调用盘古9接口  标签本身也不落表
     */
    CONTENT_CATE("6-CATE", "品类"),
    CONTENT_BRAND("6-BRAND", "品牌"),
    CONTENT_MODEL("6-MODEL", "机型"),

    ;

    /**
     * labelCode
     */
    private final String code;

    /**
     * labelName
     */
    private final String name;

    LabelCodeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    private static final Map<String, String> CODE_NAME_MAP = new HashMap<>();

    static {
        for (LabelCodeEnum anEnum : LabelCodeEnum.values()) {
            CODE_NAME_MAP.put(anEnum.getCode(), anEnum.getName());
        }
    }

    public static String getNameByCode(String code) {
        return CODE_NAME_MAP.get(code);
    }
}
